package mahan.data.model;

import java.util.HashMap;
import java.util.Map;

public class Vendor implements KeyValuePair {
	public static Vendor instance() {
		return new Vendor();
	}

	private int id;
	private String name;
	private String address;
	private String city;

	private String state;

	private String country = "US";
	private String zip;
	private String website;
	private String emailAddress;

	private String phone;

	private Vendor() {
	}

	public Vendor(int id, String name) {
		this.id = id;
		this.name = name;
	}

	public Map<String, ?> get() {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", id);
		map.put("n", name);
		map.put("add", address);
		map.put("city", city);
		map.put("state", state);
		map.put("country", country);
		map.put("email", emailAddress);
		map.put("phone", phone);
		map.put("zip", zip);
		map.put("web", website);

		return map;
	}

	public String getAddress() {
		return address;
	}

	public String getCity() {
		return city;
	}

	public String getCountry() {
		return country;
	}

	public String getEmailAddress() {
		return emailAddress;
	}

	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public String getPhone() {
		return phone;
	}

	public String getState() {
		return state;
	}

	public String getWebsite() {
		return website;
	}

	public String getZip() {
		return zip;
	}

	public void put(Map<String, ?> map) {
		id = (Integer) map.get("id");
		name = (String) map.get("n");
		address = (String) map.get("add");
		city = (String) map.get("city");
		state = (String) map.get("state");
		country = (String) map.get("country");
		emailAddress = (String) map.get("email");
		phone = (String) map.get("phone");
		zip = (String) map.get("zip");
		website = (String) map.get("web");
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public void setState(String state) {
		this.state = state;
	}

	public void setWebsite(String website) {
		this.website = website;
	}

	public void setZip(String zip) {
		this.zip = zip;
	}
}